var currentIndex = 0;  
var imgs = document.querySelectorAll(".banner-image");  

function imgLoad() {  
    // 隐藏当前图片  
    imgs[currentIndex].style.display = 'none';  

    // 更新索引  
    currentIndex = (currentIndex + 1) % imgs.length;  

    // 显示新图片  
    imgs[currentIndex].style.display = 'block';  
}  

// 将切换间隔改为3秒以实现自然切换  
setInterval(imgLoad, 3000);  

// 初始加载  
window.onload = () => {  
    imgs[currentIndex].style.display = 'block';  
};